<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:composite="http://java.sun.com/jsf/composite">

	<composite:interface>
		<composite:attribute name="editavel" default="true"/>
		<composite:attribute name="selecionados" required="true"/>
		<composite:attribute name="opcoes"  required="true"/>
		<composite:attribute name="colunas" default="4"/>
		<composite:attribute name="style" default="width:100%;"/>				
	</composite:interface>

	<composite:implementation>
	
	<style type="text/css">
		.ui-datagrid-no-border .ui-datagrid-content {
   			border: none;
   			margin-left:5%;   			
		} 
	</style>
	
		<p:dataGrid id="#{cc.id}_DataList" styleClass="ui-datagrid-no-border" value="#{cc.attrs.selecionados}" var="selecionado" columns="1" rendered="#{!cc.attrs.editavel}">
		
			<h:outputText id="#{cc.id}_Label" value="#{selecionado.nomeSecao}"
						  rendered="#{not cc.attrs.editavel}" />	
					  
		</p:dataGrid>
	
	
		<p:selectManyCheckbox id="#{cc.id}_CheckBox" converter="SerieModalidadeEnsinoSecaoDiarioDTOConverter" layout="grid" columns="#{cc.attrs.colunas}" value="#{cc.attrs.selecionados}"
		 					  style="#{cc.attrs.style}" rendered="#{cc.attrs.editavel}">
		 
			<f:selectItems value="#{cc.attrs.opcoes}" var="item" itemLabel="#{item.nomeSecao}" itemValue="#{item}" />	
			 	
		</p:selectManyCheckbox>
				
	</composite:implementation>
</html>